package itsm.isperp.module.repository.configuration;

import itsm.isperp.framework.data.mybatis.dao.CUDMapper;
import itsm.isperp.module.dto.configuration.ConfCiPropertyDTO;
import itsm.isperp.module.entity.configuration.ConfCiProperty;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 配置项属性数据库映射器
 * 
 * @author lizx
 * @date 2013-4-29
 */
@Repository
public interface ConfCiPropertyMapper extends CUDMapper<ConfCiProperty> {

	/**
	 * 根据配置项ID删除其自定义属性
	 * 
	 * @param ciid
	 *            配置项ID
	 * @return void
	 */
	public void deleteByCiId(String ciId);

	public List<ConfCiProperty> findByCiId(String ciId);

	public List<ConfCiPropertyDTO> findDetailByCiId(String ciId);

	public ConfCiProperty findByCiIdAndPropertyId(@Param("ciId") String ciId,
			@Param("propertyId") String propertyId);

	public List<ConfCiProperty> findByCiIdsAndPropertyId(
			@Param("ciIds") String[] ciIds,
			@Param("propertyId") String propertyId);

	public List<ConfCiProperty> findByCiIdAndPropertyIds(
			@Param("ciId") String ciId,
			@Param("propertyIds") String[] propertyIds);

	public List<ConfCiProperty> findByCiIdAndProperties(
			@Param("ciId") String ciId,
			@Param("properties") List<ConfCiProperty> properties);

	public void deleteByCiIdAndProperties(@Param("ciId") String ciId,
			@Param("properties") List<ConfCiProperty> properties);

}
